home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1995-01-31 | 37.4 KB | 1,231 lines | [ TEXT/KAHL]
$$Message MM Precompile headers, mmHeaders.c $$File mmHeaders.c /* $CopyRight$ */ /* mmHeaders Type definitions Name: mmHeaders.c Function: Precompile headers for Gooey™ code. History: $Date$ Original by $Author$ To add a header, change its "#if 0" to "#if 1". To remove a header, change its "#if 1" to "#if 0". THINK C NOTE: You must used 'relaxed ANSI' to do the precompile, strict ANSI will generate errors. */ #ifndef _H_MacHeaders #define _H_MacHeaders #if defined(THINK_C) || defined(THINK_CPLUS) #ifndef __SC__ // set this to 0 (zero) to retain full prototypes // set this to 1 (one) for "simplified" prototypes #define SIMPLIFY_PROTOTYPES 0 #endif #else // To allow the use of ToolBox calls which have now become obsolete on PowerPC, but // which are still needed for System 6 applications, we need to #define OBSOLETE. If // your application will never use these calls then you can comment out this #define. #define OBSOLETE 1 // Metrowerks-specific Toolbox definitions // These definitions are commonly used but not in Apple's headers. We define // them in our precompiled header so we can use the Apple headers without modification. #define PtoCstr p2cstr #define CtoPstr c2pstr #define CtoPString c2pstr #define PtoCString p2cstr #if defined(THINK_C) || defined(THINK_CPLUS) #define Length(s) (*(unsigned char *)(s)) #endif #define topLeft(r) (((Point *) &(r))[0]) #define botRight(r) (((Point *) &(r))[1]) #define TRUE true #define FALSE false // We need to include this file #include <MixedMode.h> long GetCurrentA5(void) ONEWORDINLINE(0x200D); #endif #if 0 #include <ActionAtomIntf.h> #endif #if 0 #include <ADSP.h> #endif #if 1 #include <AEObjects.h> #endif #if 1 #include <AEPackObject.h> #endif #if 0 #include <AERegistry.h> #endif #if 0 #include <AIFF.h> #endif #if 1 #ifdef __APPLETALK__ #include <Aliases.h> #else #define __APPLETALK__ // suppress unnecessary #include <AppleTalk.h> #include <Aliases.h> #undef __APPLETALK__ #endif #endif #if 1 #ifdef __EPPC__ #include <AppleEvents.h> #else #define __EPPC__ // suppress unnecessary #include <EPPC.h> #include <AppleEvents.h> #undef __EPPC__ #endif #endif #if 0 #include <AppleTalk.h> #endif #if 0 #ifdef __TRAPS__ #include <Balloons.h> #else #define __TRAPS__ // suppress unnecessary #include <Traps.h> #define _Pack14 0xA830 // (well, mostly unnecessary...) #include <Balloons.h> #undef _Pack14 #undef __TRAPS__ #endif #endif #if defined(THINK_C) || defined(THINK_CPLUS) #if 1 #include <BDC.h> #endif #endif #if 0 #include <CommResources.h> #endif #if 0 #include <Components.h> #endif #if 0 #include <Connections.h> #endif #if 0 #include <ConnectionTools.h> #endif #if 1 #include <Controls.h> #endif #if 0 #include <CRMSerialDevices.h> #endif #if 0 #include <CTBUtilities.h> #endif #if 0 #include <DatabaseAccess.h> #endif #if 1 #include <Desk.h> #endif #if 0 #include <DeskBus.h> #endif #if 1 #include <Devices.h> #endif #if 1 #include <Dialogs.h> #endif #if 1 #include <DiskInit.h> #endif #if 0 #include <Disks.h> #endif #if 0 #include <Editions.h> #endif #if 0 #include <ENET.h> #endif #if 0 #include <EPPC.h> #endif #if 1 #include <Errors.h> #endif #if 1 #include <Events.h> #endif #if 1 #include <Files.h> #endif #if 0 #include <FileTransfers.h> #endif #if 0 #include <FileTransferTools.h> #endif #if 0 #include <Finder.h> #endif #if 0 #include <FixMath.h> #endif #if 1 #include <Folders.h> #endif #if 1 #include <Fonts.h> #endif #if 1 #include <GestaltEqu.h> #endif #if 0 #include <Graf3D.h> #endif #if 0 #include <HyperXCmd.h> #endif #if 1 #include <Icons.h> #endif #if 0 #include <ImageCodec.h> #endif #if 0 #include <ImageCompression.h> #endif #if 0 #include <Language.h> #endif #if 1 #include <Lists.h> #endif #if 0 #include <MediaHandlers.h> #endif #if 1 #include <Memory.h> #endif #if 1 #include <Menus.h> #endif #if 0 #include <MIDI.h> #endif #if 0 #include <Movies.h> #endif #if 0 #include <MoviesFormat.h> #endif #if 1 #include <Notification.h> #endif #if 1 #include <OSEvents.h> #endif #if 1 #include <OSUtils.h> #endif #if 1 #include <Packages.h> #endif #if 0 #include <Palette.h> #endif #if 0 #include <Palettes.h> #endif #if 0 #include <Picker.h> #endif #if 0 #include <PictUtil.h> #endif #if 0 #include <Power.h> #endif #if 0 #include <PPCToolBox.h> #endif #if defined(THINK_C) || defined(THINK_CPLUS) #if 0 #include <Printing.h> #endif #if 1 #include <PrintTraps.h> #endif #else #if 1 #include <Printing.h> #endif #endif #if 0 #include <Processes.h> #endif #if 1 #include <QDOffscreen.h> #endif #if 1 #include <Quickdraw.h> #endif #if 0 #include <QuickTimeComponents.h> #endif #if 1 #include <Resources.h> #endif #if 0 #include <Retrace.h> #endif #if 0 #include <ROMDefs.h> #endif #if 0 #include <SANE.h> #endif #if 1 #include <Scrap.h> #endif #if 0 #include <Script.h> #endif #if 0 #include <SCSI.h> #endif #if 1 #include <SegLoad.h> #endif #if 0 #include <Serial.h> #endif #if 0 #include <ShutDown.h> #endif #if 0 #include <Slots.h> #endif #if 1 #include <Sound.h> #endif #if 0 #include <SoundInput.h> #endif #if 1 #include <StandardFile.h> #endif #if 0 #include <Start.h> #endif #if 0 #include <SysEqu.h> #endif #if 0 #include <Terminals.h> #endif #if 0 #include <TerminalTools.h> #endif #if 1 #include <TextEdit.h> #endif #if 1 #include <Timer.h> #endif #if 1 #include <ToolUtils.h> #endif #if 1 #include <Types.h> #endif #if 0 #include <Values.h> #endif #if 0 #include <Video.h> #endif #if 1 #include <Windows.h> #endif #if defined(THINK_C) || defined(THINK_CPLUS) #if 1 #include <pascal.h> #endif #if 1 #include <asm.h> #endif #else #if 0 #include <asm.h> #endif #endif #if defined(THINK_C) || defined(THINK_CPLUS) #if 1 && !defined(__cplusplus) #include <LoMem.h> #endif #if 1 #include <THINK.h> #endif #else #if 1 #include <LowMem.h> #endif #endif #if 0 #include <Traps.h> #endif #endif /* Defined to get around qd. differences */ #if defined(THINK_C) || defined(THINK_CPLUS) #define screenRect screenBits #define QDPort thePort #else #define screenRect qd.screenBits #define QDPort qd.thePort #endif #include "mmTypes$Prototype.name$.h" /* Gooey types */ /* ======================================================= */ /* ======================================================= */ $$CloseFile $$Message MM Types, mm:mmTypes$Prototype.name$.h $$File mm:mmTypes$Prototype.name$.h /* $CopyRight$ */ /* mmTypes$Prototype.name$ Type definitions Name: mmTypes$Prototype.name$.h Function: Type definitions for Gooey™ code. History: $Date$ Original by $Author$ */ /* ======================================================= */ /* ======================================================= */ /* Basic definitions */ #define NIL 0L /* Used for empty pointers and handles */ /* User event definitions */ #define UserEvent_None 0 /* No user events available */ #define UserEvent_Open_Window 1 /* Open Window or modeless dialog */ #define UserEvent_Close_Window 2 /* Close Window or modeless dialog */ #define UserEvent_Activate_Window 3 /* Activate Window or modeless dialog */ #define UserEvent_Deactivate_Window 4 /* Deactivate Window or modeless dialog */ /* IDs 0 to 999 reserved for Gooey™, all others available for special use */ /* Menu list resource IDs */ $$Loop Menus #define Res_Menu_$Menu.name$ $Menu.ID$ /* Menu resource ID, $Menu.FullName$ */ $$Loop MenuItems #define MItem_$MenuItem.name$ $MenuItem.ID$ $$EndLoop MenuItems $$EndLoop Menus $$Loop HierMenus #define Res_Menu_$Menu.name$ $Menu.ID$ /* Hier Menu resource ID, $Menu.FullName$ */ $$Loop MenuItems #define MItem_$MenuItem.name$ $MenuItem.ID$ $$EndLoop MenuItems $$EndLoop HierMenus /* Window resource IDs, also controls grouped with the appropiate window */ $$Loop Alerts /* Variables for the alert titled "$Worksheet.FullName$" */ #define ResA_$Worksheet.name$ $Worksheet.ID$ /* Alert, $Worksheet.FullName$ */ $$Loop Control.type = Button #define ResA_$Control.name$ $Control.ItemID$ /* ...Button, $Control.FullName$ */ $$EndLoop $$Loop Control.type = StaticText $$if Control.StandardText #define ResA_$Control.name$ $Control.ItemID$ /* ...Static Text, $Control.FullName$ */ $$endif $$if Control.SpecialText #define sResA_$Control.name$ $Control.StringID$ /* ...Static Text, $Control.FullName$ */ $$endif $$EndLoop $$Loop Control.type = Icon #define ResA_$Control.name$ $Control.ItemID$ /* ...Icon, $Control.FullName$ */ #define ResA_N_$Control.name$ $Control.NormalID$ #define ResA_H_$Control.name$ $Control.HilitedID$ $$EndLoop $$Loop Control.type = Picture #define ResA_$Control.name$ $Control.ItemID$ /* ...Picture, $Control.FullName$ */ $$if Control.NonGraphic #define ResA_N_$Control.name$ $Control.NormalID$ $$endif $$EndLoop $$Loop Control.type = UButton #define ResA_$Control.name$ $Control.ItemID$ /* ...Plugin button, $Control.FullName$ */ #define sResA_$Control.name$ $Control.StringID$ #define ResA_N_$Control.name$ $Control.NormalID$ #define ResA_H_$Control.name$ $Control.HilitedID$ $$EndLoop $$Loop Control.type = HotRect #define ResA_$Control.name$ $Control.ItemID$ /* ...HotSpot, $Control.FullName$ */ #define sResA_$Control.name$ $Control.StringID$ $$EndLoop $$Loop Control.type = Sicn #define ResA_$Control.name$ $Control.ItemID$ /* ...Sicn, $Control.FullName$ */ #define ResA_N_$Control.name$ $Control.NormalID$ #define ResA_H_$Control.name$ $Control.HilitedID$ $$EndLoop $$EndLoop Alerts $$Loop Dialogs /* Variables for the Dialog titled "$Worksheet.FullName$" */ #define ResD_$Worksheet.name$ $Worksheet.ID$ /* Dialog, $Worksheet.FullName$ */ $$Loop Control.type = Button #define ResD_$Control.name$ $Control.ItemID$ /* ...Button, $Control.FullName$ */ $$EndLoop $$Loop Control.type = Checkbox #define ResD_$Control.name$ $Control.ItemID$ /* ...Checkbox, $Control.FullName$ */ $$EndLoop $$Loop Control.type = Radio #define ResD_$Control.name$ $Control.ItemID$ /* ...Radio, $Control.FullName$ */ $$EndLoop $$Loop Control.type = StaticText $$if Control.StandardText #define ResD_$Control.name$ $Control.ItemID$ /* ...Static Text, $Control.FullName$ */ $$endif $$if Control.SpecialText #define sResD_$Control.name$ $Control.StringID$ /* ...Static Text, $Control.FullName$ */ $$endif $$EndLoop $$Loop Control.type = Icon #define ResD_$Control.name$ $Control.ItemID$ /* ...Icon, $Control.FullName$ */ #define ResD_N_$Control.name$ $Control.NormalID$ #define ResD_H_$Control.name$ $Control.HilitedID$ $$EndLoop $$Loop Control.type = Picture #define ResD_$Control.name$ $Control.ItemID$ /* ...Picture, $Control.FullName$ */ $$if Control.NonGraphic #define ResD_N_$Control.name$ $Control.NormalID$ $$endif $$EndLoop $$Loop Control.type = EditText #define ResD_$Control.name$ $Control.ItemID$ /* ...Edit Text, $Control.FullName$ */ #define sResD_$Control.name$ $Control.StringID$ /* ...Edit Text, $Control.FullName$ */ $$EndLoop $$Loop Control.type = ScrollBar #define ResD_$Control.name$ $Control.ItemID$ /* ...ScrollBar, $Control.FullName$ */ $$EndLoop $$Loop Control.type = UButton #define ResD_$Control.name$ $Control.ItemID$ /* ...Plugin button, $Control.FullName$ */ #define sResD_$Control.name$ $Control.StringID$ #define ResD_N_$Control.name$ $Control.NormalID$ #define ResD_H_$Control.name$ $Control.HilitedID$ $$EndLoop $$Loop Control.type = UToggle #define ResD_$Control.name$ $Control.ItemID$ /* ...Plugin toggle, $Control.FullName$ */ #define sResD_$Control.name$ $Control.StringID$ #define ResD_N_$Control.name$ $Control.NormalID$ #define ResD_H_$Control.name$ $Control.HilitedID$ $$EndLoop $$Loop Control.type = UGauge #define ResD_$Control.name$ $Control.ItemID$ /* ...Plugin gauge, $Control.FullName$ */ #define sResD_$Control.name$ $Control.StringID$ #define ResD_N_$Control.name$ $Control.NormalID$ #define ResD_H_$Control.name$ $Control.HilitedID$ $$EndLoop $$Loop Control.type = List #define sResD_$Control.name$ $Control.StringID$ /* ...List, $Control.FullName$ */ $$EndLoop $$Loop Control.type = Popup #define ResD_$Control.name$ $Control.ItemID$ /* ...Popup menu, $Control.FullName$ */ #define mResD_$Control.name$ $Control.MenuID$ $$EndLoop $$Loop Control.type = Palette #define ResD_$Control.name$ $Control.ItemID$ /* ...Palette, $Control.FullName$ */ #define ResD_N_$Control.name$ $Control.NormalID$ $$EndLoop $$Loop Control.type = HotRect #define ResD_$Control.name$ $Control.ItemID$ /* ...HotSpot, $Control.FullName$ */ #define sResD_$Control.name$ $Control.StringID$ $$EndLoop $$Loop Control.type = Sicn #define ResD_$Control.name$ $Control.ItemID$ /* ...Sicn, $Control.FullName$ */ #define ResD_N_$Control.name$ $Control.NormalID$ #define ResD_H_$Control.name$ $Control.HilitedID$ $$EndLoop $$EndLoop Dialogs $$Loop Windows /* Variables for the Window titled "$Worksheet.FullName$" */ #define ResW_$Worksheet.name$ $Worksheet.ID$ /* Window, $Worksheet.FullName$ */ $$Loop Control.type = Button #define ResC_$Control.name$ $Control.ID$ /* ...Button, $Control.FullName$ */ $$EndLoop $$Loop Control.type = Checkbox #define ResC_$Control.name$ $Control.ID$ /* ...Checkbox, $Control.FullName$ */ $$EndLoop $$Loop Control.type = Radio #define ResC_$Control.name$ $Control.ID$ /* ...Radio, $Control.FullName$ */ $$EndLoop $$Loop Control.type = StaticText #define sResC_$Control.name$ $Control.StringID$ /* ...Static Text, $Control.FullName$ */ $$EndLoop $$Loop Control.type = EditText #define sResC_$Control.name$ $Control.StringID$ /* ...Edit Text, $Control.FullName$ */ $$EndLoop $$Loop Control.type = List #define ResC_$Control.name$ $Control.ID$ /* ...List, $Control.FullName$ */ $$EndLoop $$Loop Control.type = HotRect #define ResC_$Control.name$ $Control.ID$ /* ...HotSpot, $Control.FullName$ */ #define sResC_$Control.name$ $Control.StringID$ $$EndLoop $$Loop Control.type = ScrollBar #define ResC_$Control.name$ $Control.ID$ /* ...ScrollBar, $Control.FullName$ */ $$EndLoop $$Loop Control.type = Icon #define ResC_$Control.name$ $Control.ID$ /* ...Icon, $Control.FullName$ */ #define ResC_N_$Control.name$ $Control.NormalID$ #define ResC_H_$Control.name$ $Control.HilitedID$ $$EndLoop $$Loop Control.type = Picture #define ResC_$Control.name$ $Control.ID$ /* ...Picture, $Control.FullName$ */ #define ResC_N_$Control.name$ $Control.NormalID$ $$EndLoop $$Loop Control.type = UButton #define ResC_$Control.name$ $Control.ID$ /* ...Plugin button, $Control.FullName$ */ #define sResC_$Control.name$ $Control.StringID$ #define ResC_N_$Control.name$ $Control.NormalID$ #define ResC_H_$Control.name$ $Control.HilitedID$ $$EndLoop $$Loop Control.type = UToggle #define ResC_$Control.name$ $Control.ID$ /* ...Plugin toggle, $Control.FullName$ */ #define sResC_$Control.name$ $Control.StringID$ #define ResC_N_$Control.name$ $Control.NormalID$ #define ResC_H_$Control.name$ $Control.HilitedID$ $$EndLoop $$Loop Control.type = UGauge #define ResC_$Control.name$ $Control.ID$ /* ...Plugin gauge, $Control.FullName$ */ #define sResC_$Control.name$ $Control.StringID$ #define ResC_N_$Control.name$ $Control.NormalID$ #define ResC_H_$Control.name$ $Control.HilitedID$ $$EndLoop $$Loop Control.type = Popup #define ResC_$Control.name$ $Control.ID$ /* ...Popup menu, $Control.FullName$ */ #define mResC_$Control.name$ $Control.MenuID$ $$EndLoop $$Loop Control.type = Palette #define ResC_$Control.name$ $Control.ID$ /* ...Palette, $Control.FullName$ */ #define ResC_N_$Control.name$ $Control.NormalID$ $$EndLoop $$Loop Control.type = Sicn #define ResC_$Control.name$ $Control.ID$ /* ...Sicn, $Control.FullName$ */ #define ResC_N_$Control.name$ $Control.NormalID$ #define ResC_H_$Control.name$ $Control.HilitedID$ $$EndLoop $$EndLoop Windows $$Loop Sounds #define ResS_$Sound.name$ $Sound.ID$ /* Sound, $Sound.FullName$ */ $$EndLoop /* ======================================================= */ typedef struct UserEventRec{ /* User Event Record definition */ short ID; /* ID for the type of user event */ short ID2; /* Optionally used, 2nd ID, sometimes used */ long Data1; /* Optionally used, Extra data */ long Data2; /* Optionally used, Extra data */ Handle theHandle; /* Optionally used, Handle */ struct UserEventRec **Next; /* Handle of next event in the list */ }UserEventRec,*UserEventPRec,**UserEventHRec; typedef struct WindowLocRec{ /* Window location record for Prefs */ $$Loop ModelessDialogs $$if Worksheet.SavePosition Point Loc_$Worksheet.name$; /* Top Left corner of window */ $$endif $$EndLoop $$Loop Windows $$if Worksheet.SavePosition Point Loc_$Worksheet.name$; /* Top Left corner of window */ $$endif $$EndLoop short Pad; /* Place holder for empty record */ }WindowLocRec; typedef struct HasRec{ /* Record for Gestalt checks */ Boolean ColorQD; /* Flag for Color QuickDraw being available */ Boolean FPU; /* Flag for Floating Point Math Chip being available */ Boolean AppleEvents; /* Whether AppleEvents are available */ Boolean AliasMgr; /* Whether AliasMgr is available */ Boolean EditionMgr; /* Whether EditionMgr is available */ Boolean NewStdFile; /* Whether HasNewStdFile is available */ Boolean PPCToolbox; /* Whether PPCToolbox is available */ Boolean QuickDraw32Bit; /* Whether 32Bit QuickDraw is available */ Boolean Gestalt; /* Whether Gestalt is available */ }HasRec; typedef struct FileRec{ /* Record for reading and writing files */ SFTypeList typeList; /* For use in opening files */ SFReply Reply; /* For use in getting file names */ StandardFileReply theStdFileReply; /* For use in getting file names */ short inputRefNum; /* For the input file */ short outputRefNum; /* For the output file */ Str255 inputFileName; /* For the input file */ Str255 outputFileName; /* For the output file */ }FileRec; typedef struct PrintingRec{ /* Record for printing */ THPrint hPrint; /* Printer record */ Boolean PrinterIsOpen; /* Whether printer is open or not */ short PageCount; /* For adding in page number */ short LineCount; /* For printing */ short PrinterVRes,PrinterHRes; /* Printer resolution */ short MaxPrintCharacters; /* Max characters on one line */ short MaxLines; /* Maximum lines in one page */ TPPrPort pPrPort; /* Printer port */ TPrStatus prStatus; /* Printing status */ short CopyCount; /* Number of copies to do */ }PrintingRec; /* ======================================================= */ $$Loop Alerts /* Variables for the alert titled "$Worksheet.FullName$" */ typedef struct $Worksheet.name$Rec{ /* Record for Alert */ Boolean FirstTime; /* Flag for first time thru the filter */ $$Loop Control.type = Button Boolean Enable_$Control.name$; /* ...Button global enable, $Control.FullName$ */ $$EndLoop $$Loop Control.type = HotRect Boolean Enable_$Control.name$; /* ...HotSpot global enable, $Control.FullName$ */ $$EndLoop $$Loop Control.type = Icon Boolean Enable_$Control.name$; /* ...Icon button global enable, $Control.FullName$ */ $$EndLoop $$Loop Control.type = Picture $$if Control.NonGraphic Boolean Enable_$Control.name$; /* ...Picture button global enable, $Control.FullName$ */ $$endif $$EndLoop $$Loop Control.type = UButton Boolean Enable_$Control.name$; /* ...Plugin Button global enable, $Control.FullName$ */ $$EndLoop $$Loop Control.type = Sicn Boolean Enable_$Control.name$; /* ...Sicn global enable, $Control.FullName$ */ $$EndLoop }$Worksheet.name$Rec; $$EndLoop Alerts $$Loop Dialogs /* Variables for the dialog titled "$Worksheet.FullName$" */ typedef struct $Worksheet.name$Rec{ /* Record for dialog */ DialogPtr theDialog; /* Window pointer to this dialog */ Boolean ExitDialog; /* Flag to exit dialog */ $$Loop Control.type = Button Boolean Enable_$Control.name$; /* ...Button global enable, $Control.FullName$ */ $$EndLoop $$Loop Control.type = Checkbox Boolean Enable_$Control.name$; /* ...Checkbox global enable, $Control.FullName$ */ short Value_$Control.name$; $$EndLoop $$Loop Control.type = Radio Boolean Enable_$Control.name$; /* ...Radio global enable, $Control.FullName$ */ short Value_$Control.name$; $$EndLoop $$Loop Control.type = ScrollBar Boolean Enable_$Control.name$; /* ...ScrollBar global enable, $Control.FullName$ */ short Value_$Control.name$; $$EndLoop $$Loop Control.type = Icon Boolean Enable_$Control.name$; /* ...Icon button global enable, $Control.FullName$ */ $$EndLoop $$Loop Control.type = Picture $$if Control.NonGraphic Boolean Enable_$Control.name$; /* ...Picture button global enable, $Control.FullName$ */ $$endif $$EndLoop $$Loop Control.type = EditText TEHandle TE_$Control.name$; /* ...Edit Text, $Control.FullName$ */ Str255 TEStr_$Control.name$; Rect TERect_$Control.name$; $$EndLoop $$Loop Control.type = UButton Boolean Enable_$Control.name$; /* ...Plugin Button global enable, $Control.FullName$ */ $$EndLoop $$Loop Control.type = UToggle Boolean Enable_$Control.name$; /* ...Plugin toggle global enable, $Control.FullName$ */ short Value_$Control.name$; $$EndLoop $$Loop Control.type = UGauge Boolean Enable_$Control.name$; /* ...Plugin guage global enable, $Control.FullName$ */ short Value_$Control.name$; $$EndLoop $$Loop Control.type = List ListHandle List_$Control.name$; /* ...List, $Control.FullName$ */ Rect ListRect_$Control.name$; $$EndLoop $$Loop Control.type = Popup Boolean Enable_$Control.name$; /* ...Popup menu global enable, $Control.FullName$ */ short Value_$Control.name$; $$EndLoop $$Loop Control.type = Palette Boolean Enable_$Control.name$; /* ...Palette global enable, $Control.FullName$ */ short Value_$Control.name$; $$EndLoop $$Loop Control.type = HotRect Boolean Enable_$Control.name$; /* ...HotSpot global enable, $Control.FullName$ */ Rect Rect_$Control.name$; $$EndLoop $$Loop Control.type = Sicn Boolean Enable_$Control.name$; /* ...Sicn global enable, $Control.FullName$ */ $$EndLoop }$Worksheet.name$Rec; $$EndLoop $$Loop Windows /* Variables for the window titled "$Worksheet.FullName$" */ typedef struct $Worksheet.name$Rec{ /* Record for dialog */ WindowPtr theWindow; /* Window pointer */ struct $Worksheet.name$Rec *Next; /* Handle of next in the list */ RGBColor WindowBackColor; /* Background window color */ $$if Worksheet.Document $$if Worksheet.ScrollHorz ControlHandle ScrollHHandle; /* Scrollbar for horz scrolling */ short ScrollHLeftOffset; /* Offset of control from left side */ $$endif $$if Worksheet.ScrollVert ControlHandle ScrollVHandle; /* Scrollbar for vert scrolling */ short ScrollVTopOffset; /* Offset of control from top edge */ $$endif $$endif $$Loop Control.type = Button ControlHandle Ctrl_$Control.name$; /* ...Button, $Control.FullName$ */ Boolean Enable_$Control.name$; $$EndLoop $$Loop Control.type = Checkbox ControlHandle Ctrl_$Control.name$; /* ...Checkbox, $Control.FullName$ */ Boolean Enable_$Control.name$; short Value_$Control.name$; $$EndLoop $$Loop Control.type = Radio ControlHandle Ctrl_$Control.name$; /* ...Radio, $Control.FullName$ */ Boolean Enable_$Control.name$; short Value_$Control.name$; $$EndLoop $$Loop Control.type = ScrollBar ControlHandle Ctrl_$Control.name$; /* ...ScrollBar, $Control.FullName$ */ Boolean Enable_$Control.name$; short Value_$Control.name$; $$EndLoop $$Loop Control.type = Icon $$if Control.NonGraphic ControlHandle Ctrl_$Control.name$; /* ...Icon button, $Control.FullName$ */ Boolean Enable_$Control.name$; $$endif $$EndLoop $$Loop Control.type = Picture $$if Control.NonGraphic ControlHandle Ctrl_$Control.name$; /* ...Picture button, $Control.FullName$ */ Boolean Enable_$Control.name$; $$endif $$EndLoop $$Loop Control.type = EditText TEHandle TE_$Control.name$; /* ...Edit Text, $Control.FullName$ */ Str255 TEStr_$Control.name$; Rect TERect_$Control.name$; $$EndLoop $$Loop Control.type = UButton ControlHandle Ctrl_$Control.name$; /* ...Plugin Button, $Control.FullName$ */ Boolean Enable_$Control.name$; $$EndLoop $$Loop Control.type = UToggle ControlHandle Ctrl_$Control.name$; /* ...Plugin toggle, $Control.FullName$ */ Boolean Enable_$Control.name$; short Value_$Control.name$; $$EndLoop $$Loop Control.type = UGauge ControlHandle Ctrl_$Control.name$; /* ...Plugin guage, $Control.FullName$ */ Boolean Enable_$Control.name$; short Value_$Control.name$; $$EndLoop $$Loop Control.type = List ListHandle List_$Control.name$; /* ...List, $Control.FullName$ */ Rect ListRect_$Control.name$; $$EndLoop $$Loop Control.type = Popup ControlHandle Ctrl_$Control.name$; /* ...Popup menu, $Control.FullName$ */ Boolean Enable_$Control.name$; short Value_$Control.name$; $$EndLoop $$Loop Control.type = Palette ControlHandle Ctrl_$Control.name$; /* ...Palette, $Control.FullName$ */ Boolean Enable_$Control.name$; short Value_$Control.name$; $$EndLoop $$Loop Control.type = HotRect ControlHandle Ctrl_$Control.name$; /* ...HotSpot, $Control.FullName$ */ Boolean Enable_$Control.name$; Rect Rect_$Control.name$; $$EndLoop $$Loop Control.type = Sicn ControlHandle Ctrl_$Control.name$; /* ...Sicn, $Control.FullName$ */ Boolean Enable_$Control.name$; $$EndLoop }$Worksheet.name$Rec,*$Worksheet.name$RecPtr; $$EndLoop /* ======================================================= */ /* ======================================================= */ $$CloseFile $$Message MM Common, mm:mmCommon$Prototype.name$.h $$File mm:mmCommon$Prototype.name$.h /* $CopyRight$ */ /* mmCommon$Prototype.name$ Common and Utilitys Name: mmCommon$Prototype.name$.h Function: Common for the Gooey™ specific code. History: $Date$ Original by $Author$ */ /* ======================================================= */ /* ======================================================= */ extern UserEventHRec UserEventList; /* User Event record list start */ extern EventRecord myEvent; /* Event record for all events */ extern Boolean WNE; /* WaitNextEvent trap is available */ extern short SleepValue; /* Sleep value for Wait on events */ extern Boolean doneFlag; /* Exit program flag */ extern TEHandle theInput; /* Used in text edit selections */ extern RgnHandle cursorRgn; /* Cursor region for WaitNextEvent */ extern short ReplyMode; /* Reply mode for AppleEvents */ extern Rect tempRect; /* Temporary rect, not for long term use */ extern Str255 sTemp; /* Temporary string, not for long term use */ extern short tempChar; /* Temporary use character */ extern long LTemp; /* Temporary use long variable */ extern short DType; /* Temporary use Type of dialog item */ extern Handle DItem; /* Temporary use Handle to the dialog item */ extern ControlHandle CItem; /* Temporary use Control handle */ extern WindowLocRec theWindowLocRec; extern Boolean Doing_MovableModal; /* For Movable Modal dialogs */ extern Boolean HoldOffUserEvents; /* Flag for holding off UserEvents */ extern Boolean InTheForeground; /* Flag for running in MultiFinder foreground */ extern ProcessSerialNumber gSelfPSN; extern AEAddressDesc gSelfAddress; extern HasRec Has; /* Gestalt check results */ extern FileRec Files; /* Reading and writing files */ extern PrintingRec Printing; /* Printing */ extern RGBColor Black_ForeColor,White_BackColor;/* Standard colors */ $$Loop Menus extern MenuHandle Menu_$Menu.name$; /* Menu handle, $Menu.FullName$ */ $$EndLoop $$Loop HierMenus extern MenuHandle Menu_$Menu.name$; /* Hier Menu handle, $Menu.FullName$ */ $$EndLoop $$Loop Alerts extern $Worksheet.name$Rec Rec_$Worksheet.name$; /* Record for Alert, "$Worksheet.FullName$" */ $$EndLoop Alerts $$Loop Dialogs extern $Worksheet.name$Rec Rec_$Worksheet.name$; /* Record for dialog, "$Worksheet.FullName$" */ $$EndLoop $$Loop Windows extern $Worksheet.name$RecPtr RecPtr_$Worksheet.name$; /* Record pointer for window, "$Worksheet.FullName$" */ extern $Worksheet.name$RecPtr ListRecPtr_$Worksheet.name$; extern Boolean MultipleAllowed_$Worksheet.name$; $$EndLoop #ifdef __cplusplus extern "C" { #endif /* Prototypes */ void InitAppleEvents(void); /* Initialize for AppleEvents */ pascal OSErr DispatchAppleEvent(AppleEvent *message,AppleEvent *reply,long refcon); OSErr AE_OpenedApplication(AppleEvent *message,AppleEvent *reply,long refcon); OSErr AE_QuittingApplication(AppleEvent *message,AppleEvent *reply,long refcon); Boolean MissedAnyParameters(AppleEvent *message); void AE_OpenThisFile(FSSpec *theFSSpec,short WhichFile,short TotalToOpen); void AE_PrintThisFile(FSSpec *theFSSpec,short WhichFile,short TotalToOpen); /* Handle an activate of the window */ void DoActivate(void); /* See if WaitNextEvent is available */ Boolean IsWNEIsImplemented(void); /* Check for user events */ void Handle_User_Event(void); /* Handle a hit in the window */ void DoInContent(WindowPtr whichWindow,EventRecord *myEvent); /* ======================================================= */ /* Copy Pascal strings */ void PStrCopy(Str255 *SourceString, Str255 *DestString); /* Concat Pascal strings */ void PStrCat(Str255 *SourceString, Str255 *DestString); /* Compare Pascal strings for exact match, case sensitive */ Boolean PStrCmp(StringPtr Source1String,StringPtr Source2String); WindowPtr Mk_BehindWindow(short theLayer); /* Get which window to place us behind */ void Mk_RegisterWindow(WindowPtr theWindowPtr,short theLayer);/* Place layer in RefCon and verify layers */ void Mk_ClearLayers(void); /* Init our arrays for layered windows */ void Mk_HiliteWindow(WindowPtr theWindowPtr); /* Hilite our layered window */ void Mk_DragWindow(WindowPtr theWindowPtr,Point where, Rect bounds);/* Drag our layered window */ Boolean Mk_Is_FrontWindow(WindowPtr theWindowPtr); /* Get the front window */ void Mk_CloseLayeredWindow(WindowPtr theWindowPtr);/* Close a layered window */ void U_InitPreferences(void); /* User Init the preferences */ void U_GetPrefParams(OSType *PrefCreator,OSType *PrefType,Str255 *thePrefsFilename,long *PrefsRecSize,short *thePrefsFormatRevision);/* User Get the preferences */ void U_GetPreferences(Handle thePrefsH); /* User Get the preferences */ void U_ReadPrefsPrivate(short PrefsRefNum); /* User Read the preferences */ void U_SetPreferences(Handle thePrefsH); /* User Set new preferences */ void GetPreferences(void); /* Get the preferences */ void SetPreferences(void); /* Set new preferences */ void Play_The_Sound(short ResID); void PositionWindow(WindowPtr theWindow,Point WantLocation,Point DefaultPosition); /* See if any user events are available */ void GetUserEvent(UserEventPRec TheUserEvent); /* Add a user event */ void Add_UserEvent(short ID, short ID2, long Data1, long Data2, Handle theHandle); /* Set the title for a popup control */ void SetNameForPopup(ControlHandle theControl); /* This is a routine used to make a new list */ void Make_A_List(ListHandle *theList,Rect *theListRect,WindowPtr theWindow,short theStringResourceID, short theSize,short theFont,Style theStyle,Boolean InDialog); /* This is a routine used to add strings to an existing list */ void Add_List_String(Str255 theString, ListHandle theList, Point *cSize); /* This is a routine used to get a string from a TE area, limited to 250 characters */ void Get_TE_String(TEHandle theTEArea, Str255 *theString); /* This is a routine used to create a TE area */ void Make_TE_Area(TEHandle *theTEArea, Rect *Position,short theFontSize,short theFont, short DefaultStringID); /* This is a routine used to plot an Sicn, small 16x16 icon */ void Plot_Sicn(short theSicnID, Rect *Position); /* This is a routine used to handle a scrollbar */ void HandleWScrollBar(Point myPt,short code,short Increment,short LIncrement,ControlHandle theControl); /* Open a file, user selects the file */ Boolean Do_The_Open_File(short NumberOfTypes,short *theVolRefNum,ProcPtr fileFilter,ProcPtr dlgHook); /* Save to a file, user selects the file */ Boolean Do_The_Save_File ( OSType creator, OSType fileType,Str255 *Prompt,Str255 *DefaultName, short *theVolRefNum,short *theRefNum,ProcPtr dlgHook); /* Select a volume */ Boolean Do_The_Select_Volume (FSSpec *theFile); void Close_The_Input_File(void); void Open_The_File(void); void Close_The_Output_File(void); void Save_The_File(void); void Select_Volume(void); /* Do the page setup */ void PageSetup(void); /* Do the print job setup */ void PrintJobSetup(void); /* Open the printer and driver for use */ void OpenThePrinter (Boolean *Cancelled); /* Close the printer and driver */ void CloseThePrinter(void); void Print_The_Data(void); /* Setup a dialog or alert item */ void SetupTheItem (DialogPtr theDialog,short ItemID,Boolean SizeIt,Boolean ShowIt, Boolean EnableIt,Boolean SetTheMax,Rect *thePosition ,long ExtraData ,short StringID ); /* Center a window onto the deepest color screen */ void CenterOnColorScreen(WindowPtr theWindow); /* Get the deepest color screen rect */ void GetDeepestColorScreenRect(Rect *DeepRect); /* Alert and Dialog support routines */ void HiliteDefaultButton(DialogPtr theDialog,short theItem); void CheckKeysInDialog(DialogPtr theDialog,Boolean *valMyFilter,EventRecord *theEvent,short *itemHit); void SetupNormalControl(DialogPtr theDialog,short theItem,Boolean Enabled,short InitialValue); void SetupHotSpot(DialogPtr theDialog,short theItem,Boolean MakeHotSpot,long LineWidth, long ShadowWidth,short MessageResID,Boolean Enabled); void SetupPlugin(DialogPtr theDialog,short theItem,Boolean Enabled, long NormalID,long HilitedID,short MessageResID); void SetupMinMaxValue(DialogPtr theDialog,short theItem,short min,short max,short value); void SetupPopupMenu(DialogPtr theDialog,short theItem,Boolean Enabled,short theMenuID,short value); void SetupPalette(DialogPtr theDialog,short theItem,Boolean Enabled,long NumberRows,long NumberCols, long PalPictureID,long HiliteMethod); void SetupIconSicn(DialogPtr theDialog,short theItem,Boolean Enabled, long NormalID,long HilitedID); void ClearTheRadio(DialogPtr theDialog,short theItem,short *value); /* Window support routines */ void DrawStaticTextBox(short ResID,Rect *theRect,short Justify,short theSize,short theFont,Style theStyle); void DrawStaticLine(short ResID,short Left,short Top,short theSize,short theFont,Style theStyle); void DrawTheTEArea(Rect *theTERect,TEHandle theTE,short theSize,short theFont,Style theStyle); ControlHandle MakeNormalControl(WindowPtr theWindow,short theResID,Boolean Enabled,short InitialValue); ControlHandle MakeHotSpot(WindowPtr theWindow,short theResID,Boolean MakeHotSpot,long LineWidth, long ShadowWidth,short MessageResID,Boolean Enabled); ControlHandle MakeIconSicn(WindowPtr theWindow,short theResID,Boolean Enabled, long NormalID,long HilitedID); ControlHandle MakePlugin(WindowPtr theWindow,short theResID,Boolean Enabled, long NormalID,long HilitedID,short MessageResID,short InitialValue); void MakeMinMaxValue(ControlHandle theControl,short min,short max,short value); ControlHandle MakePopupMenu(WindowPtr theWindow,short theResID,Boolean Enabled,short theMenuID,short value); ControlHandle MakePalette(WindowPtr theWindow,short theResID,Boolean Enabled,long NumberRows,long NumberCols, long PalPictureID,long HiliteMethod); void UpdateTheList(RgnHandle theRgn,ListHandle theList,Rect *theRect,short theSize,short theFont,Style theStyle,Boolean InDialog); void ClickInTheList(Point myPt,short modifiers,ListHandle theList,short theSize,short theFont,Style theStyle,Boolean InDialog); void Activate_TE_Area(Boolean InDialog,Point myPt,TEHandle theTE,short textSize,short textFont,Style textStyle); $$Loop Alerts void InitA_$Worksheet.name$(void); void PA_$Worksheet.name$(void); $$EndLoop $$Loop ModalDialogs void InitD_$Worksheet.name$(void); /* Init any global variables */ void MPD_$Worksheet.name$(void); /* Handle the modal dialog */ $$EndLoop $$Loop ModelessDialogs void Init_$Worksheet.name$(void); /* Initialize the flag for this dialog, for other routines to use */ void Moved_$Worksheet.name$(Rect *OldRect, WindowPtr theWindow); /* We were moved on the screen, or to another screen. */ void Update_$Worksheet.name$(WindowPtr theWindow); /* Update the display of this dialog, when an area is uncovered. */ void Open_$Worksheet.name$(void); /* Open the dialog and display it on the screen. */ void Do_$Worksheet.name$(EventRecord *theEvent, WindowPtr theWindow, short itemHit); /* Handle any events for this dialog, when it is active. */ void Close_$Worksheet.name$(WindowPtr theWindow); /* Close this dialog and release it from memory. */ $$EndLoop $$Loop Windows void Init_$Worksheet.name$(void); /* Initialize us so all our routines can be activated */ void Close_$Worksheet.name$(WindowPtr whichWindow); /* Close our window */ void Resized_$Worksheet.name$(Rect *OldRect, WindowPtr whichWindow); /* Handle resizing scrollbars */ void Update_$Worksheet.name$(WindowPtr whichWindow); /* Update our window, someone uncovered a part of us */ void Open_$Worksheet.name$(void); /* Open our window and draw everything */ void Activate_$Worksheet.name$(WindowPtr whichWindow, Boolean Do_An_Activate); /* Handle activation of our window */ void Do_$Worksheet.name$(EventRecord *myEvent); /* Handle action to our window, like controls */ $$EndLoop #ifdef __cplusplus } #endif /* ======================================================= */ /* ======================================================= */ $$CloseFile